package com.whc.gulimall.order.feign;

import com.whc.common.utils.R;
import com.whc.gulimall.order.vo.WareLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 仓库远程调用
 *
 * @author angaoen
 */
@FeignClient(name = "gulimall-ware", path = "/ware/wareinfo")
public interface WareFeignService {

    /**
     * 获取到地址运费
     *
     * @param addrId 地址Id
     * @return 统一返回结果
     */
    @GetMapping("/address/fare")
    R getAddressFareByAddrId(@RequestParam("addrId") Long addrId);

    /**
     * 锁库存
     *
     * @param lockVo 订单信息vo
     * @return 统一返回结果 List<LockStockResult>
     */
    @PostMapping("/lock/ware")
    R orderLockedStock(@RequestBody WareLockVo lockVo);
}
